﻿
using CSharpLibs.Annotations;

#pragma warning disable 0169

namespace System
{
	[Builtin]
	public struct Byte : IUSignIntegralValue, IComparable, IComparable<Byte>, IEquatable<Byte>
	{
		public const byte MaxValue = 255;
		public const byte MinValue = 0;

		[DummyPrimitiveField]
		private byte ff;

		public int CompareTo(object o)
		{
			if(!(o is Byte))
				Environment.Exit(1);

			return PrimitiveHelper.DoCompareOpIntegral(this, (Byte)o);
		}

		public int CompareTo(Byte b)
		{ return PrimitiveHelper.DoCompareOpIntegral(this, b); }

		public override bool Equals(object o)
		{ return (o is Byte) && (this == ((Byte)o)); }

		public bool Equals(Byte b)
		{ return this == b; }

		public override int GetHashCode()
		{ return ((byte)this); }

		public static byte Parse(string sv)
		{ return (byte)PrimitiveHelper.ParseUSignIntegral(sv); }

		public override string ToString()
		{ return PrimitiveHelper.USignIntegralToString(this); }
	}
}

#pragma warning restore 0169

